<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:php="http://php.net/xsl" xmlns="http://www.w3.org/1999/xhtml">
	<xsl:template name="AddRight">	
	
		<h1>Add a back-office access</h1>
		<form method="post" action="">
			<input type="hidden" name="reload" value="true" />
			<table>
				<tr>
					<td>Login</td>
					<td><input type="text" name="login" value="{//View/login}" /></td>
				</tr>
				<tr>
					<td>Password</td>
					<td><input type="password" name="password" /></td>
				</tr>
				<tr>
					<td>Privilege</td>
					<td>
						<xsl:if test="count(//View/bo_groups/bo_group[count(action) &gt; 0]) = 0">
							<span style="color:red;">No action from the back-office has been generated yet.</span>
							<a href="{//View/url_generate_bo}" title="Generate Bo">Generate Back-Office's actions now</a>
						</xsl:if>
						<xsl:for-each select="//View/bo_groups/bo_group[count(action) &gt; 0]">
							<fieldset style="float:left;margin-right:20px;">
								<legend>
									<input type="checkbox" onclick="javascript:checkAll('{name}',{count(action)})" id="{name}" checked="checked" />
									<label for="{name}"><xsl:value-of select="name" /></label>
								</legend>
								<div>
									<xsl:for-each select="action">
										<input type="checkbox" name="{concat('bo_action_',../name,'_',model,'_',name)}" id="{concat(../name,'_',position())}" value="{id}" checked="checked" />
										<label for="{concat(../name,'_',position())}"><xsl:value-of select="name" /></label><br />
									</xsl:for-each>
								</div>
							</fieldset>
						</xsl:for-each>
					</td>
				</tr>
				<tr>
					<td colspan="2" align="left"><input type="submit" value="Create" /></td>								
				</tr>
			</table>
		</form>
		<xsl:if test="count(//View/errors/error) &gt; 0">
			<div style="font-weight:bold;color:red;">
				<xsl:value-of select="//View/errors/error" />
			</div>
		</xsl:if>
				
	</xsl:template>
</xsl:stylesheet>